/* 
 * File:   jsonparser.h
 * Author: ossi
 *
 * Created on October 22, 2011, 6:33 PM
 */

#ifndef JSONPARSER_H
#define	JSONPARSER_H
struct hashtable;
struct dynarray;
typedef enum {
    TYPE_STRING, TYPE_INT, TYPE_HASHTABLE, TYPE_ARRAY
} json_i_type;

typedef struct json_item {
    void* data;
    json_i_type type;
} json_item;

typedef struct json_parser {
    wchar_t backbuffer;
    _Bool buf_empty;
    struct _IO_FILE* fp;
    _Bool backed;
} json_parser;


json_parser* json_init(char* filename);
struct hashtable* json_next_hashtbl(json_parser* p);
struct dynarray* json_next_array(json_parser* p);
void json_dispose(json_parser* p);
void json_item_free(json_item* ji);
#endif	/* JSONPARSER_H */

